from apps.common.base.dao import BaseDao
from apps.system.identity.serializers import *

class IdentityDao(BaseDao):
    MODEL_CLASS = Identity
    SERI_CLASS = IdentityBaseSerializer


    def findOneByGrade(self, grade):
        _identitys = self.findAll().filter(grade=grade)
        if _identitys.exists():
            return _identitys.first()
        else:
            print('级别不存在')
            return None